﻿
using UnityEngine;

public class ModelStudio
{
    protected GameObject _modelStudio;//模型摄像棚
    public GameObject Root { get { return _modelStudio; } }

    protected GameObject _modelPlace;//模型放置节点
    public GameObject ModelPlace { get { return _modelPlace; } }

    protected TouchEx _modelTouchRotate;//模型旋转节点

    protected GameObject _modelRoot;//放置的模型根节点
    public virtual void Init()
    {
        //角色摄影棚
        _modelStudio = ResManager.GetInstance().load<GameObject>("UI/ModelStudio");
        _modelPlace = _modelStudio.transform.Find("Models").gameObject;
    }
    public virtual void SetModel(GameObject modelRoot)
    {
        _modelRoot = modelRoot;
        modelRoot.transform.SetParent(_modelPlace.transform,false);
    }
    public void ClearModel()
    {
        _modelPlace.DestroyAllChildren();
    }
    public void Destroy()
    {
        ResManager.GetInstance().Release(_modelStudio);
    }
}
